package com.tianji.promotion.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tianji.promotion.domain.po.Coupon;
import com.tianji.promotion.domain.po.UserCoupon;
import com.tianji.promotion.enums.UserCouponStatus;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author Cammy
 * @description 针对表【user_coupon(用户领取优惠券的记录，是真正使用的优惠券信息)】的数据库操作Mapper
 * @createDate 2025-02-25 09:21:24
 * @Entity generator.domain.UserCoupon
 */
public interface UserCouponMapper extends BaseMapper<UserCoupon> {

    /**
     * 查询我的优惠券可用方案
     * @param userId
     * @return
     */
    List<Coupon> queryMyCoupons(@Param("userId") Long userId);

    /**
     * 根据券方案计算订单优惠明细
     * @param userCouponIds
     * @param userCouponStatus
     * @return
     */
    List<Coupon> queryCouponByUserCouponIds(List<Long> userCouponIds, UserCouponStatus userCouponStatus);
}




